import { defineConfig } from "vite"
import vue from '@vitejs/plugin-vue'
import viteCompression from 'vite-plugin-compression'

import path from "path"

export default defineConfig({
  plugins: [
    vue()
  ],
  base: "./",
  resolve: {
    alias: {
      // 如果报错__dirname找不到，需要安装node,执行yarn add @types/node --save-dev
      "@": path.resolve(__dirname, "src"),
      "comps": path.resolve(__dirname, "src/components"),
    }
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData:
          '@import "./src/styles/hack.scss";'
      }
    }
  }
})